home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / books / tech / intelerr.100 < prev    next >
Encoding:
Text File  |  1995-01-18  |  11.5 KB  |  252 lines

  1. Newsgroups: comp.lang.asm.x86,alt.msdos.programmer
  2. From: terra@diku.dk (Morten Welinder)
  3. Subject: Intel Documentation Errata (LONG)
  4. Date: Fri, 28 Oct 1994 09:41:00 GMT
  5.  
  6.  
  7. The Unofficial Intel Documentation Errata version 1.00
  8. Copyright (C) 1994 Morten Welinder
  9.  
  10. Permission is granted to anyone to make or distribute verbatim copies of this
  11. document, in any medium, provided that the copyright notice and permission
  12. notice are preserved, and that the distributor grants the recipient permission
  13. for further redistribution as permitted by this notice.
  14.  
  15. Modified versions may not be made.
  16. -------------------------------------------------------------------------------
  17. This is a list of errata in Intel's Cpu documentation.  I only have the
  18. i486 manual, but I expect most of the mistakes to be present in the i386
  19. and Pentium manuals also.
  20.  
  21. A page number like "page 486: 22-1" is a page number in "i486(tm) Processor
  22. Programmer's Reference Manual", ISBN 1-55512-101-2, Intel 1990.
  23.  
  24. I decide what counts as errata!  Suggestions are always welcome -- send
  25. email to me at <terra@diku.dk>.
  26. -------------------------------------------------------------------------------
  27. Figure 3-23: CPU_ID Detection Code, page 486: 3-42
  28.  
  29. This code is not guaranteed to work in protected mode (including V86)
  30. since the flag instructions may be emulated.  However, only old system
  31. software (like Borland Turbo Debugger TD386) will deny flipping of the
  32. AC flag.
  33. -------------------------------------------------------------------------------
  34. Figure 5-8: Segment Descriptors, page 486: 5-11
  35.  
  36. The blank 4-bit field should read "LIMIT 19:16".
  37. -------------------------------------------------------------------------------
  38. D-bit is data descriptors, page 486: 5-12
  39.  
  40. The D-bit as described is for code segments.  For data segments the same
  41. bit is sometimes called the B-bit and it is only used for stack segments
  42. where it determines whether ESP (B=1) or SP (B=0) is used.
  43. -------------------------------------------------------------------------------
  44. Causes of divide-error fault, page 486: 9-14
  45.  
  46. The divide-error fault is raised not only when dividing with zero, but
  47. also when an overflow is detected in a divide instruction.
  48. -------------------------------------------------------------------------------
  49. Returning to Real Mode, page 486: 22-4
  50.  
  51. It seems that SS (and probably CS) must be loaded with selectors that have
  52. their "Big" bit cleared.  Otherwise strange errors can occur later when
  53. the stack pointer is loaded.
  54. -------------------------------------------------------------------------------
  55. "AAD" instruction, page 486: 26-19
  56.  
  57. Note that this is a two-byte instruction.  The second byte can be any
  58. constant a it will take the place of "10".  This is undocumented and
  59. reportedly does not work on some early 8086-clones.
  60. -------------------------------------------------------------------------------
  61. "AAM" instruction, page 486: 26-20
  62.  
  63. Note that this is a two-byte instruction.  The second byte can be any
  64. constant a it will take the place of "10".  This is undocumented.
  65. If the constant is zero then exception 0 is raised.
  66. -------------------------------------------------------------------------------
  67. "BT" instruction, page 486: 26-36
  68.  
  69. The opcode for "BT r/m16,imm8" should be "0F BA /4 ib".
  70. -------------------------------------------------------------------------------
  71. "CALL" instruction, page 486: 26-44
  72.  
  73. Note that the 16-bit displacement version will clear the upper half of
  74. EIP even in a 32-bit code segment.  Therefore it should not be used in
  75. such a segment unless you are certain that the destination will never
  76. exceed 64K.
  77. -------------------------------------------------------------------------------
  78. "CLTS" instruction, page 486: 26-55
  79.  
  80. Under V86 mode an #GP(0) is always generated.
  81. -------------------------------------------------------------------------------
  82. "CMPXCHG" instruction, page 486: 26-62
  83.  
  84. Note that some versions of Borland's Turbo Assembler get this instruction
  85. wrong.
  86. -------------------------------------------------------------------------------
  87. "DEC" instruction, page 486: 26-67
  88.  
  89. The opcode for "DEC r/m32" should be "FF /1".
  90. -------------------------------------------------------------------------------
  91. "ENTER" instruction, page 486: 26-70
  92.  
  93. The value assigned to `frame-ptr' should be ESP if the stack is "Big"
  94. and SP if not.
  95.  
  96. Great care should be taken with "ENTER" and "LEAVE" when the stack segment
  97. size is 32 bits and the code segment size is 16 bits.  It is easy to
  98. destroy the upper half of ESP.  Use equivalent simpler (and ususally faster)
  99. instructions instead.
  100. -------------------------------------------------------------------------------
  101. "FSTSW" instruction, page 486: 26-136
  102.  
  103. The second form of the instruction should be "FSTSW AX".
  104. -------------------------------------------------------------------------------
  105. "INC" instruction, page 486: 26-164
  106.  
  107. The opcode for "INC r/m32" should be "FF /0".
  108. -------------------------------------------------------------------------------
  109. "INT" instructions, page 486: 26-167
  110.  
  111. Page 23-8 states that interrupt instructions are IOPL sensitive in V86
  112. mode.
  113. -------------------------------------------------------------------------------
  114. "Jcc" conditional jump instructions, page 486: 26-180
  115.  
  116. Note that the 16-bit displacement versions will clear the upper half of
  117. EIP even in a 32-bit code segment.  Therefore they should not be used in
  118. such a segment unless you are certain that the destination will never
  119. exceed 64K.  The same is true for "JCXZ" (as opposed "JECXZ").
  120.  
  121. It is usually faster and simpler to test CX/ECX with ordinary instructions.
  122. -------------------------------------------------------------------------------
  123. "JMP" instruction, page 486: 26-183
  124.  
  125. Note that the 16-bit displacement version will clear the upper half of
  126. EIP even in a 32-bit code segment.  Therefore it should not be used in
  127. such a segment unless you are certain that the destination will never
  128. exceed 64K.  (The same is true for the 8-bit displacement version, but
  129. who would add an operand size prefix for that?)
  130. -------------------------------------------------------------------------------
  131. "LEAVE" instruction, page 486: 26-193
  132.  
  133. Great care should be taken with "ENTER" and "LEAVE" when the stack segment
  134. size is 32 bits and the code segment size is 16 bits.  It is easy to
  135. destroy the upper half of ESP.  Use equivalent simpler (and faster)
  136. instructions instead.
  137. -------------------------------------------------------------------------------
  138. "LIDT"/"LGDT" instructions, page 486: 26-195
  139.  
  140. Under V86 mode an #GP(0) is always generated.
  141. -------------------------------------------------------------------------------
  142. "LGS" instruction, page 486: 26-196
  143.  
  144. In case `LGS:' the "DS" should read "GS".
  145. -------------------------------------------------------------------------------
  146. "LLDT" instruction, page 486: 26-199
  147.  
  148. Under V86 mode an #GP(0) is always generated.
  149. -------------------------------------------------------------------------------
  150. "LOOP" instructions, page 486: 26-206
  151.  
  152. The specification fails to state that when the operand size is 16 bits (and
  153. the condition is satisfied) then the upper half of EIP is cleared.
  154.  
  155. For this reason the CX versions should not be used in a 32-bit segment
  156. unless you are certain that the destination will never exceed 64K. It
  157. is benificial anyway to use a decrement and standard jump.
  158. -------------------------------------------------------------------------------
  159. "MOV" instructions, page 486: 26-211
  160.  
  161. The specification fails to mention that moves into CS are not allowed.
  162. -------------------------------------------------------------------------------
  163. "POPAD" instruction, page 486: 26-234
  164.  
  165. The "POPAD" instruction is sligtly buggy on most 386s.  To avoid problems
  166. always have a non-memory referencing instruction (e.g., "NOP") immediately
  167. following.
  168. -------------------------------------------------------------------------------
  169. "PUSH" instruction, page 486: 26-237
  170.  
  171. The specification fails to mention that an 8-bit operand is sign-extended
  172. before being pushed.
  173. -------------------------------------------------------------------------------
  174. "RCL"/"RCR"/"ROL"/"ROR" instructions, page 486: 26-242
  175.  
  176. As stated elsewhere in the documentation these instruction do absolutely
  177. nothing when the effective shift count is zero.  In particular, and in spite
  178. of what is written here, no flags are affected.  If you are not sure that
  179. CL is non-zero (mod 32) then you should not assume that "R[CO][LR] ...,CL"
  180. sets any flags.
  181.  
  182. Note that there are two different versions of the instructions shifting
  183. by one bit.  Assemblers usually select the shortest (implied operand) which
  184. is important to know because the two different forms set different flags.
  185. -------------------------------------------------------------------------------
  186. "REP"/"REPE"/"REPNE" instructions, page 486: 26-245
  187.  
  188. Note that ECX is used exactly when ESI is.  Note also that "REP LODSB"
  189. does makes sense with certain memory mapped hardware like VGA cards.
  190.  
  191. The description for "CMPS" and "SCAS" saying that "JCXZ" can be used
  192. for testing why the looping stopped is *wrong*.  Use the Z flag.  When
  193. the condition ends up false (meaning (E)CX did not cause the exiting)
  194. note that (E)SI/(E)DI have been stepped.
  195. -------------------------------------------------------------------------------
  196. "SAL"/"SAR"/"SHL"/"SHR" instructions, page 486: 26-253
  197.  
  198. As stated elsewhere in the documentation these instruction do absolutely
  199. nothing when the effective shift count is zero.  In particular, and in spite
  200. of what is written here, no flags are affected.  If you are not sure that
  201. CL is non-zero (mod 32) then you should not assume that "S[AH][LR] ...,CL"
  202. sets any flags.
  203.  
  204. Note that there are two different versions of the instructions shifting
  205. by one bit.  Assemblers usually select the shortest (implied operand) which
  206. is important to know because the two different forms set different flags.
  207. -------------------------------------------------------------------------------
  208. "SHLD" instruction, page 486: 26-264
  209.  
  210. Contrary to the stated information this instruction seems to work also
  211. in the case where the shift amount is exactly the same as the operand
  212. size.
  213. -------------------------------------------------------------------------------
  214. "SHRD" instruction, page 486: 26-264
  215.  
  216. Contrary to the stated information this instruction seems to work also
  217. in the case where the shift amount is exactly the same as the operand
  218. size.
  219. -------------------------------------------------------------------------------
  220. "WAIT" instruction, page 486: 26-281
  221.  
  222. (Cpus with on-chip Fpu only.)  If the instruction immediately following
  223. this instruction is an Fpu-instruction then no exception is raised.
  224. -------------------------------------------------------------------------------
  225. "XADD" instruction, page 486: 26-283
  226.  
  227. Note that some versions of Borland's Turbo Assembler get this instruction
  228. wrong.
  229. -------------------------------------------------------------------------------
  230. "XCHG" instruction, page 486: 26-285
  231.  
  232. The timings are incorrect for "XCHG AX,AX" and "XCHG EAX,EAX" which
  233. execute in one cycle.
  234. -------------------------------------------------------------------------------
  235. Standard OPCODE map, page 486: A-4
  236.  
  237. There should be no instruction at 0x82.
  238. -------------------------------------------------------------------------------
  239. 0F OPCODE map, page 486: A-6
  240.  
  241. The instruction at 0x20 to 0x24 and 0x26 should have their operands reversed,
  242. i.e., the first should read "MOV Rd,Cd".
  243. -------------------------------------------------------------------------------
  244. Extension OPCODE map, page 486: A-8
  245.  
  246. The instruction at (7,111) should read "INVLPG EW".
  247. -------------------------------------------------------------------------------
  248. Index.
  249.  
  250. B bit ("big bit", stack), see D bit.
  251.  
  252.